package com.suixinsanren.design.state.demo.demo02;

public class SoldOutState implements State {

    private final GumballMachine gumballMachine;

    public SoldOutState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("不能投入硬币，因为糖果已经售空");
    }

    @Override
    public void ejectQuarter() {
        System.out.println("不能退换银币，你还没有投入硬币");
    }

    @Override
    public void turnCrank() {
        System.out.println("你转动了曲柄，但是糖果已经售空");
    }

    @Override
    public void dispense() {
        System.out.println("已经转动曲柄，但是机器里没有糖果了");
    }

    @Override
    public String toString() {
        return "糖果已售完";
    }
}
